package com.runshu.newsmartark.mvp.presenter;


import com.runshu.newsmartark.mvp.contract.ReadCardContract;
import com.runshu.newsmartark.network.netbean.ResponseBean;
import com.runshu.newsmartark.network.netinterface.MyCallBack;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/8/3
 * @decs：
 */

public class ReadCardPresenter implements ReadCardContract.Presenter {
    private ReadCardContract.View view;
    private ReadCardContract.Model model;

    public ReadCardPresenter(ReadCardContract.View view, ReadCardContract.Model model) {
        this.view = view;
        this.model = model;
    }

    @Override
    public void verifyIcCard(String icCard) {
        model.verifyIcCard(icCard, new MyCallBack() {
            @Override
            public void onSuccess(ResponseBean data) {
                view.verifyIcCardSuccess(data);
            }

            @Override
            public void onError(ResponseBean data) {
                view.onError(data.getMessage());
            }
        });

    }
}